﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d" xmlns:ElisVK="clr-namespace:ElisVK;assembly=ElisVK" 
	xmlns:controls="clr-namespace:ElisVK.Controls;assembly=ElisVK" xmlns:TaskbarNotification="clr-namespace:TaskbarNotification;assembly=TaskbarNotification">
	<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
	<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Controls~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
	<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
	<!--ImageButton-->
	<Style x:Key="ImageButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Button">
					<Image x:Name="Img" Source="{Binding Path=Active}" />
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="Img" Property="Source" Value="{Binding Path=Hover}"/>
						</Trigger>
						<Trigger Property="IsPressed" Value="True">
							<Setter TargetName="Img" Property="Source" Value="{Binding Path=Pressed}"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="False">
							<Setter TargetName="Img" Property="Source" Value="{Binding Path=Disabled}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
	<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Window Styles~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
	<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
	<SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FF292929"/>
	<SolidColorBrush x:Key="SplitterBrush" Color="DarkGray"/>


	<Style TargetType="{x:Type Button}" x:Key="WindowStateButton">
		<Setter Property="OverridesDefaultStyle" Value="True"/>
		<Setter Property="IsTabStop" Value="False"/>
		<Setter Property="Focusable" Value="False"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Button}">
					<Grid Background="Transparent">
						<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
					</Grid>
					<ControlTemplate.Triggers>
						
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<ControlTemplate x:Key="MainWindowCtrlTemplate" TargetType="{x:Type ElisVK:MainWindow}">
		<AdornerDecorator>
			<DockPanel LastChildFill="True" Background="White">
				<DockPanel x:Name="PART_WindowHeader" DockPanel.Dock="Top" LastChildFill="True"
						   Height="35" Background="#575a4b">
					<Image DockPanel.Dock="Left" Width="25" Margin="5,0,0,0"
						   Source="/BasicSkin;component/Res/ApplicationIcon.ico" />
					<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" 
								HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,8,0">
						<Button Width="28" x:Name="PART_Minimize">
							<Button.Style>
								<Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
									<Style.Triggers>
										<DataTrigger Binding="{Binding  RelativeSource={RelativeSource TemplatedParent}, Path=IsActive}" 
													 Value="false">
											<Setter Property="IsEnabled" Value="false"/>
										</DataTrigger>
									</Style.Triggers>
								</Style>
							</Button.Style>
						</Button>
						<Grid>
							<Button Width="28" x:Name="PART_Maximize">
								<Button.Style>
									<Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
										<Setter Property="Visibility" Value="Visible"/>
										<Setter Property="IsEnabled" Value="true"/>
										<Style.Triggers>
											<DataTrigger Binding="{Binding  RelativeSource={RelativeSource TemplatedParent}, Path=WindowState}" 
															Value="{x:Static WindowState.Maximized}">
												<Setter Property="Visibility" Value="Hidden"/>
												<Setter Property="IsEnabled" Value="false"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding  RelativeSource={RelativeSource TemplatedParent}, Path=IsActive}" 
															Value="false">
												<Setter Property="IsEnabled" Value="false"/>
											</DataTrigger>
										</Style.Triggers>
									</Style>
								</Button.Style>
							</Button>
							<Button Width="28" x:Name="PART_Restore">
								<Button.Style>
									<Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
										<Setter Property="Visibility" Value="Hidden"/>
										<Setter Property="IsEnabled" Value="false"/>
										<Style.Triggers>
											<DataTrigger Binding="{Binding  RelativeSource={RelativeSource TemplatedParent}, Path=WindowState}" 
															Value="{x:Static WindowState.Maximized}">
												<Setter Property="Visibility" Value="Visible"/>
												<Setter Property="IsEnabled" Value="true"/>
											</DataTrigger>
											<DataTrigger Binding="{Binding  RelativeSource={RelativeSource TemplatedParent}, Path=IsActive}" 
															Value="false">
												<Setter Property="IsEnabled" Value="false"/>
											</DataTrigger>
										</Style.Triggers>
									</Style>
								</Button.Style>
							</Button>
						</Grid>
						<Button Width="28" x:Name="PART_Close">
							<Button.Style>
								<Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
									<Style.Triggers>
										<DataTrigger Binding="{Binding  RelativeSource={RelativeSource TemplatedParent}, Path=IsActive}" 
													 Value="false">
											<Setter Property="IsEnabled" Value="false"/>
										</DataTrigger>
									</Style.Triggers>
								</Style>
							</Button.Style>
						</Button>
					</StackPanel>
					<TextBlock x:Uid="IDS_WindowCaption" 
							   VerticalAlignment="Center" Margin="8,0,0,0"
							   FontFamily="Segoe UI" FontSize="13" Foreground="White"
							   Text="ElisVK">
					</TextBlock>
				</DockPanel>
				<StackPanel DockPanel.Dock="Top" Height="0" Background="#dfdfdf">
				</StackPanel>
				<StackPanel DockPanel.Dock="Bottom" Height="3" Background="{StaticResource SplitterBrush}">
				</StackPanel>
				<Grid>
					<!--<Image Height="100" VerticalAlignment="Top"
									Source="/BasicSkin;component/Res/WindowHeader.jpg" Stretch="Fill">
						<Image.OpacityMask>
							<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
								<GradientStop Offset="0" Color="Black"/>
								<GradientStop Offset="1" Color="Transparent"/>
							</LinearGradientBrush>
						</Image.OpacityMask>
					</Image>-->
					<ContentPresenter Margin="0"/>
				</Grid>
			</DockPanel>
		</AdornerDecorator>
		<ControlTemplate.Triggers>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	
	<Style TargetType="{x:Type ElisVK:MainWindow}">
		<Setter Property="Template" Value="{StaticResource MainWindowCtrlTemplate}"/>
		<Setter Property="WindowStyle" Value="None"/>
		<Setter Property="Height" Value="600"/>
		<Setter Property="Width" Value="729"/>
		<Setter Property="MinHeight" Value="480"/>
		<Setter Property="MinWidth" Value="640"/>
		<Setter Property="Icon" Value="..\res\ApplicationIcon.ico"/>
	</Style>
	
	<Style TargetType="{x:Type TaskbarNotification:TaskbarIcon}">
		<Setter Property="IconSource" Value="..\res\ApplicationIcon.ico"></Setter>
	</Style>

	
	<!--******************************************************************************-->
	<!--***********Filter TextBox*****************************************************-->
	<!--******************************************************************************-->
	<SolidColorBrush x:Key="IconTextBox_Background" Color="White" />
	<SolidColorBrush x:Key="IconTextBox_Foreground" Color="Black" />
	<LinearGradientBrush x:Key="IconTextBox_Border" StartPoint="0,0" EndPoint="0,1">
		<GradientStop Color="#FFABADB3" Offset="0.05" />
		<GradientStop Color="#FFE2E3EA" Offset="0.07" />
		<GradientStop Color="#FFE3E9EF" Offset="1" />
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="IconTextBox_BorderMouseOver" StartPoint="0,0" EndPoint="0,1">
		<GradientStop Color="#FF5C97C1" Offset="0.05" />
		<GradientStop Color="#FFB9D7EB" Offset="0.07" />
		<GradientStop Color="#FFC7E2F1" Offset="1" />
	</LinearGradientBrush>
	<SolidColorBrush x:Key="IconTextBox_IconBorder" Color="White" />
	<SolidColorBrush x:Key="IconTextBox_IconBackground" Color="White" />
	<LinearGradientBrush x:Key="IconTextBox_IconBorder_MouseOver" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#FFFFFFFF" Offset="0" />
		<GradientStop Color="#FFE5F4FC" Offset="1" />
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="IconTextBox_IconBackground_MouseOver" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#FFE7F5FD" Offset="0" />
		<GradientStop Color="#FFD2EDFC" Offset="0.5" />
		<GradientStop Color="#FFB6E3FD" Offset="0.51" />
		<GradientStop Color="#FF9DD5F3" Offset="1" />
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="IconTextBox_IconBorder_MouseDown" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#FFFFFFFF" Offset="0" />
		<GradientStop Color="#FFE5F4FC" Offset="1" />
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="IconTextBox_IconBackground_MouseDown" StartPoint="0,0" EndPoint="0,1" >
		<GradientStop Color="#FFE7F5FD" Offset="0" />
		<GradientStop Color="#FFD2EDFC" Offset="0.5" />
		<GradientStop Color="#FFB6E3FD" Offset="0.51" />
		<GradientStop Color="#FF9DD5F3" Offset="1" />
	</LinearGradientBrush>
	<SolidColorBrush x:Key="IconTextBox_LabelTextColor" Color="Gray" />
	
	<Style x:Key="{x:Type controls:FilterTextBox}" TargetType="{x:Type controls:FilterTextBox}">
		<Setter Property="Background" Value="{StaticResource IconTextBox_Background}" />
		<Setter Property="BorderBrush" Value="{StaticResource IconTextBox_Border}" />
		<Setter Property="Foreground" Value="{StaticResource IconTextBox_Foreground}" />
		<Setter Property="BorderThickness" Value="1" />
		<Setter Property="SnapsToDevicePixels" Value="True" />
		<Setter Property="LabelText" Value="Search" />
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="LabelTextColor" Value="{StaticResource IconTextBox_LabelTextColor}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type controls:FilterTextBox}">
					<Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}">
						<Grid x:Name="LayoutGrid">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*" />
								<ColumnDefinition Width="{Binding RelativeSource={RelativeSource TemplatedParent},
												  Path=ActualHeight}" />
							</Grid.ColumnDefinitions>
							<ScrollViewer Margin="2" x:Name="PART_ContentHost" Grid.Column="0" />
							<Label x:Name="LabelText" Margin="2" Grid.Column="0"
								   Foreground="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=LabelTextColor}"
								   Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=LabelText}"
								   Padding="2,0,0,0" FontStyle="Italic" />
							<Border x:Name="PART_IconBorder" Grid.Column="1" BorderThickness="1" VerticalAlignment="Stretch"
									HorizontalAlignment="Stretch" BorderBrush="{StaticResource IconTextBox_IconBorder}"
									Background="{StaticResource IconTextBox_IconBackground}">
								<Image x:Name="FilterIcon" Stretch="None" Width="15" HorizontalAlignment="Center"
									   VerticalAlignment="Center" Source="..\Res\Filter.png" />
							</Border>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter Property="BorderBrush" Value="{StaticResource IconTextBox_BorderMouseOver}" />
						</Trigger>
						<Trigger Property="IsKeyboardFocusWithin" Value="True">
							<Setter Property="BorderBrush" Value="{StaticResource IconTextBox_BorderMouseOver}" />
						</Trigger>
						<Trigger Property="HasText" Value="True">
							<Setter Property="Visibility" TargetName="LabelText" Value="Hidden" />
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="HasText" Value="True" />
								<Condition Property="FilterMode" Value="Instant" />
							</MultiTrigger.Conditions>
							<Setter Property="Source" TargetName="FilterIcon" Value="..\Res\clear.png" />
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" SourceName="PART_IconBorder" Value="True" />
								<Condition Property="HasText" Value="True" />
							</MultiTrigger.Conditions>
							<Setter Property="BorderBrush" TargetName="PART_IconBorder"
									Value="{StaticResource IconTextBox_IconBorder_MouseOver}" />
							<Setter Property="Background" TargetName="PART_IconBorder"
									Value="{StaticResource IconTextBox_IconBackground_MouseOver}" />
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" SourceName="PART_IconBorder" Value="True" />
								<Condition Property="IsMouseLeftButtonDown" Value="True" />
								<Condition Property="HasText" Value="True" />
							</MultiTrigger.Conditions>
							<Setter Property="Padding" TargetName="PART_IconBorder" Value="2,0,0,0" />
							<Setter Property="BorderBrush" TargetName="PART_IconBorder"
									Value="{StaticResource IconTextBox_IconBorder_MouseOver}" />
							<Setter Property="Background" TargetName="PART_IconBorder"
									Value="{StaticResource IconTextBox_IconBackground_MouseOver}" />
						</MultiTrigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>        
</ResourceDictionary>